package com.atguigu.practice;

public class FindTheMaxAreaOfTriangle {
    public static double triangleArea(double x1,double x2,double x3,double y1,double y2,double y3){
        return 0.5*Math.abs(x1*y2-x1*y3+x2*y3-x2*y1+x3*y1-x2*y2);
    }
    public static void main(String[] args) {
        int[][] points=new int[][]{{0,0},{0,1},{1,0},{0,2},{2,0}};
        double ret=0.0;
        for(int i=0;i<points.length;i++){
            for(int j=i+1;j<points.length;j++){
                for(int k=j+1;k<points.length;k++){
                    ret=Math.max(ret,triangleArea(points[i][0],points[j][0],points[k][0],points[i][1],points[j][1],points[k][1]));
                }
            }
        }
        System.out.println(ret);
    }
}
